package com.freewater.springboot.demo.spel.inlinemap;

import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;

import java.util.Map;

public class Main {
    public static void main(String[] args) {
        ExpressionParser parser = new SpelExpressionParser();
        final Map emptyMap = (Map) parser.parseExpression("{:}").getValue();
        System.out.println(emptyMap);

        Map inventorInfo = (Map) parser.parseExpression("{name:'Nikola',dob:'10-July-1856'}").getValue();
        System.out.println(inventorInfo);

        Map mapOfMaps = (Map) parser.parseExpression("{name:{first:'Nikola',last:'Tesla'},dob:{day:10,month:'July',year:1856}}").getValue();
        System.out.println(mapOfMaps);
    }
}
